{literal}
    <script type="text/javascript">
        $(document).ready(function() {
            $(document).click(function(){
                hideRentabilityOverlay();
            });
        });
    </script>
{/literal}

<h2 class="pageTitle">Servis rentability</h2>

<div class="menu-list">
    <form action="{$data.root}?input=servis_rentability" method="post">

        <select size="1" name="period">
            {foreach $data.periods as $period}
                <option {if $period.period==$data.prefillPeriod}selected="selected"{/if} value="{$period.period}">{$period.period}</option>
            {/foreach}
        </select>
        <input value="Show" type="submit" />
    </form>
</div>

<table class="list">
    <tr>
        <th>Servisný pracovník</th>
        <th>Z1</th>
        <th>Z2</th>
        <th>Z3</th>
        <th>Náklady</th>
        <th>Výnos</th>
        <th class="positionHandler">Rentabilita</th>
    </tr>
    {foreach $data.servisaci as $servisak}
        <tr>
            <td>{$servisak.name} {$servisak.surname}</td>
            <td>+ {$servisak.z1|round:"2"}</td>
            <td>+ {$servisak.z2|round:"2"}</td>
            <td>+ {$servisak.z3|round:"2"}</td>
            <td>= {$servisak.expense|round:"2"}</td>
            <td>{$servisak.revenue|round:"2"}</td>
            {if $servisak.rentability !== '-'}
                <td {if $servisak.rentability|round:"2" < 1}style="color: red"{/if} onmouseover="getRentabilityTablePerTasks('{$servisak.users_id}','{$data.prefillPeriod}')">{$servisak.rentability|round:"2"}</td>
            {else}
                <td>{$servisak.rentability}</td>
            {/if}
        </tr>
    {/foreach}
</table>

<div id="rentOverlay">
    <div id="rentOverlayContent">

    </div>
</div>